<?php
/**
 * Created by PhpStorm.
 * User: wzy12
 * Date: 2018/10/18
 * Time: 11:29
 */

namespace app\admin\validate;


use think\Validate;

class Order extends Validate
{
    protected $rule = [
        "consignee|收货人" => 'require',
        "mobile|手机号" =>'require|number',
        "province" => 'require',
        "city" => 'require',
        "district" => 'require',
        "address" => 'require',
        "shipping_code" => 'require',
        '__token__' => 'token|require'
    ];

    protected $message = [
        '__token__.require'  =>  '请不要进行非法操作',
        'province.require' => '请选择省',
        'city.require' => '请选择市',
        'district.require' => '请选择县',
        'address.require' => '请填写地址',
        "shipping_code.require" => '请选择物流方式',
    ];

    protected $scene = [
        'del' => ['__token__'],
        'cost' => ['__token__', 'shipping_price' => 'require', 'discount' => 'require']
    ];
}